// ===== 全局样式文件 - 基于 Arco Design 原生能力 =====

// 基础样式重置
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: var(--font-size-body-1);
  line-height: 1.5715;
  color: var(--color-text-1);
  background-color: var(--color-bg-2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  height: 100vh;
  overflow: hidden;
}

// ===== 滚动条优化 =====
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-border-3);
  border-radius: 3px;
  transition: background-color var(--motion-duration-normal);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-border-4);
}

// ===== 布局工具类（基于Arco Design规范）=====
.page-container {
  padding: var(--spacing-large);
  background: var(--color-bg-2);
  min-height: calc(100vh - var(--layout-header-height));
}

// 网格系统
.grid {
  display: grid;
  gap: var(--spacing-large);
  
  &.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
  &.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  &.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  &.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  
  @media (max-width: 1200px) {
    &.grid-cols-4 {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @media (max-width: 768px) {
    &.grid-cols-2,
    &.grid-cols-3,
    &.grid-cols-4 {
      grid-template-columns: 1fr;
    }
  }
}

// Flex 工具类
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-column { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }

// 间距工具类
.m-0 { margin: 0; }
.mb-2 { margin-bottom: var(--spacing-small); }
.mb-3 { margin-bottom: var(--spacing-medium); }
.mb-4 { margin-bottom: var(--spacing-large); }
.mt-2 { margin-top: var(--spacing-small); }
.mt-4 { margin-top: var(--spacing-large); }
.p-0 { padding: 0; }

// 文本工具类
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

// ===== 表格优化 =====
.arco-table {
  .arco-table-cell {
    // 操作列按钮优化
    .arco-space-item .arco-btn[type="text"] {
      padding: 0 var(--spacing-small);
      
      &:hover {
        background-color: var(--color-fill-2);
      }
      
      &[status="danger"]:hover {
        color: var(--color-danger-6);
        background-color: var(--color-danger-1);
      }
    }
  }
}

// ===== 响应式工具类 =====
@media (max-width: 768px) {
  .hidden-mobile { display: none !important; }
  .page-container { padding: var(--spacing-medium); }
}

@media (max-width: 576px) {
  .hidden-mobile-sm { display: none !important; }
}

// ===== 动画类 =====
.fade-enter-active,
.fade-leave-active {
  transition: opacity var(--motion-duration-normal) var(--motion-ease-standard);
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

// ===== 加载和空状态（使用Arco Design组件）=====
.loading-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.empty-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--color-text-3);
}

// ===== NProgress样式优化 =====
#nprogress {
  .bar {
    background: var(--color-primary-6) !important;
    height: 3px !important;
  }

  .peg {
    box-shadow: 0 0 10px var(--color-primary-6), 0 0 5px var(--color-primary-6) !important;
  }

  .spinner {
    display: none !important;
  }
} 